package io.github.annyylxyms.gyn.gateway;

import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

/**
 * gateway plugin
 * @author annyylxyms
 * @since 2024-12-17
 */
public interface GatewayPlugin {

    String GATEWAY_PREFIX = "/ga";

    //接入接出协议初始化等操作
    void start();

    //销毁
    void stop();

    //plugin名字
    String getName();

    //用来是否支持处理ServerWebExchange，不支持不处理
    boolean support(ServerWebExchange exchange);

    Mono<Void> handle(ServerWebExchange exchange, GatewayPluginChain chain);

}
